<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ev="http://purl.org/rss/1.0/modules/event/" xmlns="http://purl.org/rss/1.0/">
  <channel>
    <title><?php e($sitename);?>: News</title>
    <link><?php e($siteurl);?></link>
    <description><?php e($sitename);?>'s Event Feed</description>
    <language>en-gb</language>
    <pubDate><?php echo date("D, j M Y H:i:s", gmmktime()) . ' GMT';?></pubDate>
    <generator>Web Rocket</generator>
	<?php foreach ($events as $event): ?>
	<item>
	<title><?php echo $event['EventType']['name']; ?>: <?php echo $event['Event']['venue']; ?></title>
	  <link><?php e($siteurl);?>/events/view/<?php e($event['Event']['id']);?></link>
	  <guid><?php e($siteurl);?>/events/view/<?php e($event['Event']['id']);?></guid>
	  <dc:creator><?php e($event['User']['username']);?></dc:creator>
	  <description><![CDATA[<?php e($event['Event']['notes']);?>]]></description>
	  <pubDate><?php echo $time->nice($time->gmt($event['Event']['created'])) . ' GMT'; ?></pubDate>
	  <ev:startdate><?php echo $time->nice($time->gmt($event['Event']['event_date'])) . ' GMT'; ?></ev:startdate>
	  <ev:location><?php e($event['Event']['address']);?>, <?php e($event['Event']['city']);?>, <?php print_r($country['Country']['name']);?>, <?php e($event['Event']['postcode']);?></ev:location>
	  <ev:type><?php echo $event['EventType']['name']; ?></ev:type>
    </item>
    <?php endforeach; ?>
  </channel>
</rss>